package lc.Q200_250;

import lc.TreeNode;

public class Q226 {

    public TreeNode invertTree(TreeNode root) {
        // 翻转。将也就是将左右节点替换
        // 递归
        if (root == null) return null;
        TreeNode left = root.left;
        TreeNode right = root.right;
        root.left = invertTree(right);
        root.right = invertTree(left);
        return root;
    }
}
